/**
 * Created by ylf on 2018/10/12.
 */
var noAfList;
var startDom;
var endDom;
$(document).ready(function () {
    noAfList = $('#noAfList');
    $('.xh-datagrid-toolbar').parseToolbar();
    startDom    = $('#List_Search_StartTime');
    endDom      = $('#List_Search_EndTime');
    startDom.datebox();
    endDom.datebox();
    noAfList.initDataGrid(baseUrl + 'short/index/getNoAfList',{queryParams:getParams()}).setSelectThenEnable(['bt_list_del']);
    xhTool.bindDocKeyDown($('#bt_list_search'));
    $('#bt_list_search').click(function () {
        noAfList.addDataGridParams(getParams());
    });
    DataGrid.onDblClickRow=function (rowIndex, rowData) {
        var iNoId = rowData['iTodoId'];
        var str=rowData['iType'];
        window.top.xhTop.showModal({
            title:rowData['sTitle'],
            content: '<iframe src="'+baseUrl+'short/Index/noticeDetail?id='+iNoId+'"  style="width: 100%;;border-style: none;padding: 0px;height:520px"  scrolling="yes"   ></iframe>',
        });
        return false;
    }
});
function GetDateStr(AddDayCount) {
    var dd = new Date();
    dd.setDate(dd.getDate()+AddDayCount);//获取AddDayCount天后的日期
    var y = dd.getFullYear();
    var m = dd.getMonth()+1;//获取当前月份的日期
    var d = dd.getDate();
    return y+"-"+m+"-"+d;
}
function getParams() {
    var key = xhExtra.getValue($('#list_search'));
    var startTime   = startDom.getElementValue(),
        endTime     = endDom.getElementValue();
    var type        =xhExtra.getValue($('#select_type'))
    var params={key:key,startTime:startTime,endTime:endTime,type:type};
    return params;
}